package com.mazaiting.unpacking

import android.os.Environment
import com.facebook.react.ReactActivity
import com.facebook.react.ReactActivityDelegate
import com.facebook.react.ReactNativeHost
import com.facebook.react.ReactPackage
import com.facebook.react.shell.MainReactPackage
import java.util.*

/**
 * 新页面
 */
class NetActivity : ReactActivity() {
  override fun getMainComponentName(): String? {
    return "NetActivity"
  }
  
  override fun createReactActivityDelegate(): ReactActivityDelegate =
          object: ReactActivityDelegate(this, mainComponentName) {
            override fun getReactNativeHost(): ReactNativeHost = object : ReactNativeHost(MainApplication.getInstance()) {
              override fun getPackages(): MutableList<ReactPackage> = Arrays.asList(MainReactPackage())
  
              override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
  
              override fun getJSBundleFile(): String? = "${Environment.getExternalStorageDirectory()}/bundle/index1.android.bundle"
            }
          }
}
